package code.generate.bean;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.google.common.base.CaseFormat;

/**
 * Created by vcd on 2014/3/25.
 */
public class Table implements Serializable {

	private static final long serialVersionUID = -3310822365730949197L;

	private String dbName;

    private Column primaryKey;

    private List<Column> columns;

    private List<Column> commonColumns;

    public String getDbName() {
        return dbName;
    }
    
    public String getGenerateClassName(){
    	return StringUtils.capitalize(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, dbName));
    }
    
    public String getUnCapGenerateClassName(){
    	return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, dbName);
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public List<Column> getColumns() {
        return columns;
    }

    public void setColumns(List<Column> columns) {
        this.columns = columns;
    }

    public Column getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(Column primaryKey) {
        this.primaryKey = primaryKey;
    }

    public List<Column> getCommonColumns() {
        return commonColumns;
    }

    public void setCommonColumns(List<Column> commonColumns) {
        this.commonColumns = commonColumns;
    }
    
}
